#ifndef __CHAT_H_INCLUDED
#define __CHAT_H_INCLUDED

/*
 * External Functions
 */
extern void CenterOnScreen(HWND hWnd);

extern BOOL WinsockStart(int nSockets);
extern BOOL WinsockEnd(int nMaxUsers);
extern BOOL WinsockOpen();
extern BOOL WinsockClose(int nMaxUsers, SOCKET s = NULL);
extern BOOL WinsockListen(HWND hWnd, int nPort, char *szUserID);
extern BOOL WinsockAccept(int nMaxUsers);
extern BOOL WinsockConnect(HWND hWnd, SOCKADDR_IN *serverInfo, char *userID);
extern BOOL WinsockReadType(SOCKET s, char *szType);
extern BOOL WinsockSend(const char *text, SOCKET s = NULL);
extern BOOL WinsockReadData(SOCKET s, char **data);
extern BOOL WinsockSetUser(SOCKET s, int nMaxUsers, char *szUserID);
extern BOOL WinsockGetUser(SOCKET s, int nMaxUsers, char **szUserID, COLORREF *crText);
extern BOOL WinsockSetColor(SOCKET s, int nMaxUsers, COLORREF color);
extern BOOL WinsockBroadcast(int nMaxUsers);
extern BOOL WinsockSendAll(const char *szSend, int nMaxUsers);
extern BOOL WinsockGetColor(const char *szName, int nMaxUsers, COLORREF *color);

extern BOOL CALLBACK dlgConnectProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

extern void EnableMenu(HMENU hMenu, UINT menuID, BOOL bEnabled = TRUE);

extern void AddSystemText(HWND, const char *);
extern void AddNotify(HWND hEdit, const char *text, COLORREF crText);
extern BOOL ChatSend(const char *szCMD, const char *szData, SOCKET s = NULL);
extern BOOL ChatSendMsg(const char* szName, COLORREF color, const char *szData, int nMaxUsers);
extern void AddChatMsg(HWND hEdit, const char *szName, COLORREF crText, const char *szMsg);
extern BOOL ChatSendAll(const char *szCMD, const char *szData, int nMaxUsers);

#endif